package com.bwda.dsrs.systemservice.domain.form.verifycode;

import com.bwda.dsrs.base.util.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author yangjun
 */
@Data
@ApiModel(description = "验证码记录表，仅做记录，不做验证")
public class VerifyCodeCreateForm {

	@ApiModelProperty(value = "用户编码")
	private String userCode;

	@ApiModelProperty(value = "姓名")
	private String userName;

	@ApiModelProperty(value = "验证码")
	private String verifyCode;

	@ApiModelProperty(value = "验证码详细内容")
	private String verifyContent;

	@ApiModelProperty(value = "请求URI")
	private String requestUri;

	@ApiModelProperty(value = "请求内容")
	private String requestContent;

	@ApiModelProperty(value = "创建时间,格式为:" + DateUtil.FORMAT)
	@DateTimeFormat(pattern = DateUtil.FORMAT)
	private Date createTime;

	@ApiModelProperty(value = "失效时间,格式为:" + DateUtil.FORMAT)
	@DateTimeFormat(pattern = DateUtil.FORMAT)
	private Date invaliadTime;

	@ApiModelProperty(value = "验证码类型")
	private Integer verifyType;

	public Date getCreateTime() {
		if (createTime != null){
			return (Date) createTime.clone();
		}

		return null;
	}

	public void setCreateTime(Date createTime) {
		if (createTime != null){
			this.createTime = (Date) createTime.clone();
		}
	}

	public Date getInvaliadTime() {
		if (invaliadTime != null){
			return (Date) invaliadTime.clone();
		}

		return null;
	}

	public void setInvaliadTime(Date invaliadTime) {
		if (invaliadTime != null){
			this.invaliadTime = (Date) invaliadTime.clone();
		}
	}
}